# Maintainer: George Rawlinson <grawlinson@archlinux.org>

pkgname=python-sphinx-tabs
pkgver=3.4.1
pkgrel=2
pkgdesc='Create tabbed content in Sphinx documentation'
arch=('any')
url='https://sphinx-tabs.readthedocs.io/'
license=('MIT')
depends=(
  'python'
  'python-sphinx'
  'python-docutils'
  'python-pygments'
)
makedepends=(
  'git'
  'python-build'
  'python-installer'
  'python-wheel'
  'python-setuptools'
)
_commit='9431223384729010ba29c27c2d2976ce76b7e1ad'
source=("$pkgname::git+https://github.com/executablebooks/sphinx-tabs#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd "$pkgname"

  git describe --tags | sed 's/^v//'
}

build() {
  cd "$pkgname"

  python -m build --wheel --no-isolation
}

package() {
  cd "$pkgname"

  python -m installer --destdir="$pkgdir" dist/*.whl

  # license
  install -vDm644 -t "$pkgdir/usr/share/licenses/$pkgname" LICENSE
}
